<?php

namespace App\Http\Controllers\Api\InnerApi;

use Illuminate\Http\Request;

class VehicleAuthController extends InnerApiBaseController
{
    /**
     * 车场授权
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function issued(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/RemoteControl',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 授权列表
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function vehicleInfo(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','vehicle_auth/GetAuthInfos',['form_params'=>$request->all()]);

        return $res->getBody();
    }
    /**
     * 移出授权
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function vehicleRemove(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','vehicle_auth/Delete',['form_params'=>$request->all()]);

        return $res->getBody();
    }
    /**
     * 创建授权
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function vehicleAdd(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','vehicle_auth/Delete',['form_params'=>$request->all()]);

        return $res->getBody();
    }

}
